// src/store/modules/websocket.js

const state = {
    socket: null,
};

const mutations = {
    SET_SOCKET(state, socket) {
        state.socket = socket;
    },
};

const actions = {
    initWebSocket({ commit }) {
        const socket = new WebSocket(process.env.VUE_APP_WEBSOCKET_URL);
        commit('SET_SOCKET', socket);
    },
};

export default {
    namespaced: true,
    state,
    mutations,
    actions,
};